﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Windows.Forms;

namespace CourseArraging.Frm.jcxx
{
    /// <summary>
    /// 版权所有
    /// 石世特@温州医学院 sst330381@gmail.com
    /// </summary> 
    public class FrmInfoGrade : FrmInfoBase
    {
        // Fields
        private IContainer components; 

         //Events
        public event refreshlist reflist;

        // Methods
        public FrmInfoGrade()
        {
            this.components = null;
            this.InitializeComponent();
        }

        public FrmInfoGrade(int id, string content)
            : base(id, content)
        {
            this.components = null;
            this.InitializeComponent();
            this.Text = "年级信息";
        }

        public override bool be4save()
        {
            return true;
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void InitializeComponent()
        {
            this.components = new Container();
//            base.AutoScaleMode = AutoScaleMode.Font;
            this.Text = "FrmInfoGrade";
        }

        public override void tsb_save_fun()
        {
            if (string.IsNullOrEmpty(base.label_id.Text))
            {
                base.basicdao.addGradeInfo(base.txt_content.Text);
                MessageBox.Show("添加成功 !");
            }
            else
            {
                base.basicdao.updateGradeInfo(int.Parse(base.label_id.Text), base.txt_content.Text);
                MessageBox.Show("修改成功 !");
            }
            base.Close();
            this.reflist();
        }

        // Nested Types
        public delegate void refreshlist();
    }

 

}
